<?php
function array_key_relative($array, $current_key, $offset = 1, $strict = true) {
  // create key map
  $keys = array_keys($array);
  // find current key
  $current_key_index = array_search($current_key, $keys, $strict);
  // return desired offset, if in array, or false if not
  if(isset($keys[$current_key_index + $offset])) {
    return $keys[$current_key_index + $offset];
  }
  return false;
}
$previous_key = array_key_relative($search_results, $current_row, -1);
$next_key = array_key_relative($search_results, $current_row, 1);
?>
